Skip to content

Add support for Renesas RA CEU (Capture Engine Unit) for RA8M1 and RA8D1 #92146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

thaoluonguw
Copy link
Collaborator

Add support for Renesas RA CEU (Capture Engine Unit):

  • Add video driver use CEU
  • Add dts for CEU on RA8M1 and RA8D1
  • Enable CEU support for EK-RA8D1
  • Add support for EK-RA8D1 on Video capture to LVGL sample.
    It works with OV7670 camera, and MIPI graphics expansion board included in the Kit

Copy link

github-actions bot commented Jun 25, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_renesas zephyrproject-rtos/hal_renesas@0769fe1 zephyrproject-rtos/hal_renesas@985d39b (main) zephyrproject-rtos/hal_renesas@0769fe15..985d39b1

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_renesas DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jun 25, 2025
Copy link
Collaborator

@josuah josuah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for implementing the Renesas video driver!

The driver appears in a good shape WRT video APIs, with a few key points to modify (marked with :x), and a few proposal to improve it further, non-blocking (i.e. could be improved over time eventually, although appreciated if modified now).

Let me know if anything needs clarifications.

@josuah
Copy link
Collaborator

josuah commented Jun 26, 2025

[blocking ❌]
In order to make sure this driver always compiles even after Video APIs are refactored, you may want to add it to this test that will run on CI on every video-related commit:
tests/drivers/build_all/video/app.overlay

}
}

static int video_renesas_ra_ceu_get_format(const struct device *dev, struct video_format *fmt)
Copy link
Collaborator

@ngphibang ngphibang Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name is rather long, could it be shorten like ra_ceu_get_format ?. Idem for others

fsp_err_t err;
int ret;

fmt->pitch = fmt->width * video_bits_per_pixel(fmt->pixelformat) / BITS_PER_BYTE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big deal but fmt->pitch should be computed at the end when everything is OK as it is the value that application will read back.

Comment on lines +46 to +78
child-binding:
child-binding:
include: video-interfaces.yaml

properties:
hsync-active:
required: true

vsync-active:
required: true

pclk-sample:
required: true

vsync-sample:
required: true
type: int
enum:
- 0 # Falling edge
- 1 # Rising edge
description: |
Sample on the falling or rising edge of the vsync signal.

hsync-sample:
required: true
type: int
enum:
- 0 # Falling edge
- 1 # Rising edge
description: |
Sample on the falling or rising edge of the hsync signal.

bus-width:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you redefine many properties that are already defined in video-interfaces.yaml ?

Update hal_renesas to support CEU on RA SoCs

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add support for the Renesas RA Capture Engine Unit (CEU),
including driver source files, Kconfig options, and DTS bindings.

- Add initial implementation of the RA CEU driver
- Add dedicated Kconfig and CMake integration
- Provide Devicetree bindings for the RA CEU
- Update module Kconfig to include the new driver

This enables image capture functionality using the CEU peripheral
on Renesas RA series MCUs.

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add pin definitions required by the RA Capture Engine Unit

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add CEU to r7fa8d1xh.dtsi and r7fa8m1xh.dtsi

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
- Add CEU pin configuration to ek_ra8d1-pinctrl.dtsi
- Enable CEU node and Arducam 20-pin connector in ek_ra8d1.dts
- Configure PWM3 as external XCLK via pwm-clock node
- Update board YAML to declare video support

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
KhanhNguyen-RVC and others added 3 commits July 3, 2025 22:48
Support OV7670 DVP 20-pin shield on the EK-RA8D1 board

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add EK-RA8D1 board support for capture and capture_to_lvgl samples

Signed-off-by: Khanh Nguyen <khanh.nguyen.wz@bp.renesas.com>
Add SW1 configuration for using Camera Exapansion Port (J59)

Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
@thaoluonguw thaoluonguw force-pushed the support_renesas_ra_ceu branch from 92a4b3b to 03bdbce Compare July 4, 2025 04:15
@github-actions github-actions bot added the area: Shields Shields (add-on boards) label Jul 4, 2025
@github-actions github-actions bot removed the DNM (manifest) This PR should not be merged (controlled by action-manifest) label Jul 4, 2025
Copy link

sonarqubecloud bot commented Jul 4, 2025

Copy link
Collaborator

@josuah josuah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the modifications!
I have "folded" the points it does resolve to allow you to keep track of feedback.
A few items left might need some adjustment (i.e. for CI), but I am looking forward to see this merged!

\
PINCTRL_DT_INST_DEFINE(inst); \
\
static struct video_renesas_ra_ceu_config video_renesas_ra_ceu_config##inst = { \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the latest changes, it might be enough to add const:

-	static struct video_renesas_ra_ceu_config video_renesas_ra_ceu_config##inst = {            \
+	static const struct video_renesas_ra_ceu_config video_renesas_ra_ceu_config##inst = {            \

@@ -11,6 +11,7 @@ tests:
- platform:mimxrt1170_evk/mimxrt1176/cm7:SHIELD="nxp_btb44_ov5640;rk055hdmipi4ma0"
- platform:mimxrt1170_evk@B/mimxrt1176/cm7:SHIELD="nxp_btb44_ov5640;rk055hdmipi4ma0"
- platform:frdm_mcxn947/mcxn947/cpu0:SHIELD="dvp_20pin_ov7670;lcd_par_s035_8080"
- platform:ek_ra8d1:SHIELD="dvp_20pin_ov7670;rtkmipilcdb00000be"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[blocking ❌]
It is possible that the current CI failure happens as the sample.yaml platform definition need the board listed with all the qualifiers. Maybe something like this but am not familiar enough with this chip to be entirely sure:

Suggested change
- platform:ek_ra8d1:SHIELD="dvp_20pin_ov7670;rtkmipilcdb00000be"
- platform:ek_ra8d1/r7fa8d1bhecbd:SHIELD="dvp_20pin_ov7670;rtkmipilcdb00000be"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Pinctrl area: Samples Samples area: Shields Shields (add-on boards) area: Video Video subsystem manifest manifest-hal_renesas platform: Renesas RA Renesas Electronics Corporation, RA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants